<script>
import { baseUrl } from './common/env.js'
import { getAccountInfoSync } from './common/base'
export default {
	globalData: {
		nickName: '',
		phoneNumberCode: '',
		phone: '',
		token: '',
		logString: function (str) {
			console.log(str)
		},
		cityName: '',
		hosipitalName: '',
		hosipitalId: '',
		orgId: '',
		uploadDomain: baseUrl(),
		reqChannel: 100013,
		scanDomain:
			getAccountInfoSync().miniProgram.appId === 'wx2dca4153fa9b81d9'
				? 'https://yilife.cn'
				: 'https://gateway-dev.yilife.cn',
		appId: getAccountInfoSync().miniProgram.appId,
	},
	onLaunch: function (e) {},
	onShow: function () {
		// wx.setVisualEffectOnCapture({
		// 	visualEffect: 'hidden',
		// 	success: res => {
		// 		console.log(res)
		// 	},
		// 	fail: err => {
		// 		console.log(err)
		// 	},
		// 	complete: res => {
		// 		console.log(res)
		// 	}
		// })
		const updateManager = uni.getUpdateManager()
		updateManager.onCheckForUpdate(function (res) {})
		updateManager.onUpdateReady(function (res) {
			uni.showModal({
				title: '更新提示',
				content: '新版本已经准备好，是否重启应用？',
				success(res) {
					if (res.confirm) {
						updateManager.applyUpdate()
					}
				},
			})
		})
	},
	onHide: function () {},
}
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uni-scss/index.scss';
@import '@/common/css/common.scss';
@import '@/static/iconfont.css';
/* #ifndef APP-NVUE */
@import '@/static/customicons.css';
// 设置整个项目的背景色
page {
	background-color: #f5f5f5;
}
/* #endif */
</style>
